#include <iostream>
#include <cstdio>

using namespace std;

const int N = 25;

typedef long long LL;

LL a, b, c; 
LL f[N][N][N];

LL w(LL a, LL b, LL c)
{
	if(a <= 0 || b <= 0 || c <= 0) return 1;
	if(a > 20 || b > 20 || c > 20) return w(20, 20, 20);
	
	//a,b,c都在0~20之间了
	//1.如果这个数已经填了，就返回
	if(f[a][b][c]) return f[a][b][c];

	//2.这个数没填，填了再返回
	if(a < b && b < c) return f[a][b][c] = w(a, b, c - 1) + w(a, b - 1, c - 1) - w(a, b - 1, c);
	else return f[a][b][c] = w(a - 1, b, c) + w(a - 1, b - 1, c) + w(a - 1, b, c - 1) - w(a - 1, b - 1, c - 1);
}

int main()
{
	while(cin >> a >> b >> c)
	{
		if(a == -1 && b == -1 && c == -1) break;
		printf("w(%lld, %lld, %lld) = %lld\n", a, b, c, w(a, b, c));
	}

	return 0;
}

